<%@ page pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <c:url var="base" value="/"/>
    <base href="${base}">
    <meta charset="UTF-8">
    <title>新闻公告后台</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        a{
            text-decoration: none;
        }
        ul,li{
            list-style: none;
            padding: 10px 0;
        }
        .clear{
            clear: both;
        }
        .area{
            background: rgba(243, 221, 201, 0.8);
            border-radius: 10px;
            padding: 20px;
            margin-top: 20px;
        }
        .main{
            width: 60%;
            margin-left: 20%;
        }
        .blank{
            height: 30px;
        }
        p{
            font-size: 30px;
        }
        body{
            background-image: url("images/background2.jpg");
            background-repeat: repeat;
        }
        .righttop{
            position: absolute;
            right: 5px;
            top: 5px;
        }
        .lefttop{
            position: absolute;
            left: 5px;
            top: 5px;
        }
        input[type="text"]{
            width: 100%;
            word-break: break-all;
        }
        .btn {
            display: inline-block;
            background-color: #00d9ff;
            color: black;
            padding: 10px 15px;
            text-decoration: none;
            border-radius: 5px;
            border: 2px rgba(91, 91, 91, 0.8) solid;
        }
        input[type="text"]{
            font-size: 30px;
            padding: 10px;
        }
        textarea{
            font-size: 20px;
            width: 100%;
            resize:none;
            padding: 10px;
            word-spacing: 2px;
        }
        .size{
            font-size: 25px;
        }
    </style>
</head>
<body>
<div class="lefttop"><a class="btn" href="index">返回首页</a><a class="btn" href="newsmanage">后台管理</a><a class="btn" href="newslist">返回列表</a></div>
<div>
    <%@include file="/WEB-INF/jsp/logbutton.jsp" %>
</div>
<div>
    <div class="blank"></div>
    <div class="blank"></div>
    <div class="main">
        <form action="update" method="post" id="1">
            <div class="clear area">
                <input style="display: none" type="text" name="id" value="<c:out value='${items2.id}'/>"/>
                <p>标题<input type="text" name="name" required placeholder="输入标题" value="<c:out value='${items2.name}'/>"/></p>
                <div class="blank"></div>
                <p>
                    内容<br>
                    <textarea name="content" rows="10" placeholder="输入内容">${items2.content}</textarea>
                </p>
                <div class="blank"></div>
                <%if("new".equals(request.getParameter("op"))){%>
                <input class="btn size" name="op" style="color: black" type="submit" value="新建">
                <%}else if("update".equals(request.getParameter("op"))){ %>
                <input class="btn size" name="op" style="color: black" type="submit" value="更新">
                <%}%>
            </div>
        </form>
    </div>
</div>
</body>
</html>